﻿using System.Windows.Navigation;
using GalaSoft.MvvmLight.Messaging;
using GalaSoft.MvvmLight.Threading;
using Microsoft.Phone.Controls;

namespace SAFPodcast.WP8
{
    /// <summary>
    /// Description for ViewFeedView.
    /// </summary>
    public partial class ViewFeedView : PhoneApplicationPage
    {
        /// <summary>
        /// Initializes a new instance of the ViewFeedView class.
        /// </summary>
        public ViewFeedView()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Messenger.Default.Register<bool>(this, "NavigationBackRequest", (b) =>
                DispatcherHelper.RunAsync(NavigationService.GoBack));
            base.OnNavigatedTo(e);
        }

        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            Messenger.Default.Unregister<bool>(this, "NavigationBackRequest");
            base.OnNavigatedFrom(e);
        }
    }
}
